<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>图书管理页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="<%=basePath %>/static/js/jquery-3.3.1.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=basePath %>/static/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="<%=basePath %>/static/css/basic.css">
    <script src="<%=basePath %>/static/js/bootstrap.min.js"></script>
    <style>
        .bootstrap-admin-panel-content {
            padding-top: 10px;
        }
        
        .black_overlay {
            display: none;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.3);
            z-index: 1001;
            filter: alpha(opacity=88);
        }
        
        .white_content {
            display: none;
            position: absolute;
            top: 8%;
            left: 25%;
            width: 50%;
            height: auto;
            padding: 20px;
            border: 1px solid gray;
            background-color: white;
            z-index: 1002;
            overflow: auto;
            border-radius: 8px;
        }
        
        .btn-sm {
            margin-left: 30px;
        }
        
        textarea {
            resize: none;
        }
    </style>
    <script>
        $(function () {
            $(".add-book").on("click", function () {
                $("#light").hide().fadeIn(600).css("display", "block");
                $("#fade").hide().fadeIn(600).css("display", "block");
            });


            $(".closeBtn").on("click", function () {
                $("#light").fadeOut(600).hide(300);
                $("#light-up").fadeOut(600).hide(300);
                $("#fade").fadeOut(600).hide(300);
                $("#light-watch").fadeOut(600).hide(300);
                $("#light-update").fadeOut(600).hide(300);
                $("#light-import-excel").fadeOut(600).hide(300);
            });

            /*每一个书籍的查看按钮的注册点击事件*/
            $(".btn-watch").on("click", function () {

                let parent = $(this).parent().parent();
                // let bookId = parent.find(".bookId").text();
                // alert(bookId);
                $("#bookId-wt").val(parent.find(".bookId").text());
                $("#isbn-wt").val(parent.find(".isbn").text());
                $("#bookName-wt").val(parent.find(".bookName").text());
                $("#typeId-wt").val(parent.find(".typeName").text());
                $("#author-wt").val(parent.find(".author").text());
                $("#publisher-wt").val(parent.find(".publisher").text());
                $("#totalCount-wt").val(parent.find(".totalCount").text());
                $("#currentCount-wt").val(parent.find(".currentCount").text());
                $("#price-wt").val(parent.find(".price").text());
                $("#putdate-wt").val(new Date(parent.find(".putdate").text()).toLocaleString());
                $("#description-wt").val(parent.find(".description").text());

                $("#light-watch").hide().fadeIn(600).css("display", "block");
                $("#fade").hide().fadeIn(600).css("display", "block");
            })


            $(".btn-update").on("click", function () {

                let parent = $(this).parent().parent();

                $("#bookId-up").val(parent.find(".bookId").text());
                $("#isbn-up").val(parent.find(".isbn").text());
                $("#bookName-up").val(parent.find(".bookName").text());

                let typeId = parent.find(".typeId").text();
                let options = $("select#typeId-up option");
                // alert(options.length);
                // alert(typeId);
                options.eq(parseInt(typeId) - 1).attr("selected", "selected");

                // $("#typeId-up").val(parent.find(".typeName").text());
                $("#author-up").val(parent.find(".author").text());
                $("#publisher-up").val(parent.find(".publisher").text());
                $("#totalCount-up").val(parseInt(parent.find(".totalCount").text()));
                $("#currentCount-up").val(parseInt(parent.find(".currentCount").text()));
                $("#price-up").val(parent.find(".price").text());
                // $("#putdate-up").val(new Date(parent.find(".putdate").text()).toLocaleString());
                $("#description-up").val(parent.find(".description").text());


                $("#light-update").hide().fadeIn(600).css("display", "block");
                $("#fade").hide().fadeIn(600).css("display", "block");
            });

            $(".add-books").on("click", function () {


                $("#light-import-excel").hide().fadeIn(600).css("display", "block");
                $("#fade").hide().fadeIn(600).css("display", "block");
            });


        })
    </script>
</head>
<body>
<!--头部-->
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="javascript:;">欢迎来到图书管理系统</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                <!--<li><a href="javascript:;" class="btn btn-default btn-login">登录</a></li>-->
                <li class="dropdown" style="margin-top: 5px;">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                       aria-haspopup="true" aria-expanded="false"> <span
                        class="glyphicon glyphicon-user"></span> 欢迎您， admin <span
                        class="caret"></span></a>
                    <ul class="dropdown-menu" style="margin-top: 2px">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="#">Separated link</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<!--主体-->
<div class="container-fluid" id="main">
    <div class="row">
        <div class="col-md-2 left-content">
            <div class="aside-nav">
                <ul class="list-group aside-nav-list">
                    <li class="list-group-item active">
                        <a href="<%=basePath%>/admin/bookmanager/1">图书管理
                            <span class="pull-right glyphicon glyphicon-chevron-right"></span>
                        </a>
                    </li>
                    <li class="list-group-item "><a href="<%=basePath%>/admin/booktypemanager">图书分类管理
                        <span
                            class="pull-right glyphicon glyphicon-chevron-right"></span></a></li>
                    <li class="list-group-item "><a href="javascript:;">图书借阅 <span
                        class="pull-right glyphicon glyphicon-chevron-right"></span></a></li>
                    <li class="list-group-item "><a href="javascript:;">图书归还 <span
                        class="pull-right glyphicon glyphicon-chevron-right"></span></a></li>
                    <li class="list-group-item "><a href="javascript:;">借阅查询 <span
                        class="pull-right glyphicon glyphicon-chevron-right"></span></a></li>
                    <li class="list-group-item "><a href="javascript:;">逾期处理 <span
                        class="pull-right glyphicon glyphicon-chevron-right"></span></a></li>
                    <li class="list-group-item ">
                        <a href="<%=basePath%>/admin/adminmanager">管理员管理
                            <span class="pull-right glyphicon glyphicon-chevron-right"></span>
                        </a>
                    </li>
                    <li class="list-group-item ">
                        <a href="<%=basePath%>/admin/readermanager">读者管理
                            <span class="pull-right glyphicon glyphicon-chevron-right"></span>
                        </a>
                    </li>
                    <li class="list-group-item"><a href="<%=basePath%>/admin/setting">系统设置
                        <span
                            class="pull-right glyphicon glyphicon-chevron-right"></span></a></li>
                    <li class="list-group-item "><a href="javascript:;">在线考试 <span
                        class="pull-right glyphicon glyphicon-chevron-right"></span></a></li>
                </ul>
            </div>
        </div>
        <div class="col-md-10 right-content">
            <%--模糊查询的搜索框--%>
            <div class="row">
                <div class="col-md-12">
                    <div class="section-wrap">
                        <div class="wrap-top">
                            <div class="panel panel-default">
                                <div class="panel-heading">图书查询</div>
                                <div class="panel-body">
                                    <form class="form-horizontal" method="post"
                                          action="<%=basePath%>/admin/bookmanager/1">
                                        <div class="form-group col-md-6">
                                            <label for="isbn"
                                                   class="col-sm-3 control-label text-right">图书ISBN</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control"
                                                       id="isbn"
                                                       name="isbn" placeholder="图书ISBN">
                                            </div>
                                        </div>
                                        <div class="form-group col-md-6">
                                            <label for="typeId"
                                                   class="col-sm-3 control-label text-right">图书分类</label>
                                            <div class="col-sm-9">
                                                <select
                                                    class="form-control" id="typeId"
                                                    name="typeId">
                                                    <option></option>
                                                    <c:forEach items="${booktypes}"
                                                               var="bt">
                                                        <option
                                                            value="${bt.typeId}">${bt.typeName}</option>
                                                    </c:forEach>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group col-md-6">
                                            <label for="bookName"
                                                   class="col-sm-3 control-label text-right">图书名称</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control"
                                                       id="bookName"
                                                       name="bookName" placeholder="图书名称">
                                            </div>
                                        </div>
                                        <div class="form-group col-md-6">
                                            <label for="author"
                                                   class="col-sm-3 control-label text-right">作者名称</label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control"
                                                       id="author"
                                                       name="author" placeholder="作者名称">
                                            </div>
                                        </div>
                                        <div class="form-group col-md-6">
                                            <label for="publisher"
                                                   class="col-sm-3 control-label text-right">出版社名称
                                            </label>
                                            <div class="col-sm-9">
                                                <input type="text" class="form-control"
                                                       id="publisher"
                                                       name="publisher" placeholder="出版社名称">
                                            </div>
                                        </div>
                                        <div
                                            class="form-group col-md-6">
                                            <button class="btn btn-primary btn-sm">查询
                                            </button>
                                            <input type="button"
                                                   class="btn btn-info btn-sm add-book"
                                                   value="添加图书" />
                                            <input type="button"
                                                   class="btn btn-success btn-sm add-books"
                                                   value="批量添加" />
                                            <a href="<%=basePath%>/book/writeExcel"
                                               class="btn btn-danger btn-sm">
                                                导出excel
                                            </a>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <%--显示表格的div--%>
            <div class="wrap-bottom">
                <table class="table table-bordered">
                    <thead>
                    <tr>
                        <th class="hidden bookId">图书编号</th>
                        <th class="hidden typeId">图书类型编号</th>
                        <th class="hidden putdate">上架日期</th>
                        <th class="hidden description">描述</th>
                        <th class="bookName">书名</th>
                        <th class="typeName">图书类型</th>
                        <th class="isbn">ISBN</th>
                        <th class="author">作者</th>
                        <th class="publisher">出版社</th>
                        <th class="totalCount">总数量</th>
                        <th class="currentCount">可借</th>
                        <th class="hidden price">价格</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <c:if test="${bookVoList!=null}">
                        <tbody>
                        <c:forEach items="${bookVoList}" var="bookVo">
                            <tr>
                                <td class="hidden bookId">${bookVo.bookId}</td>
                                <td class="hidden typeId">${bookVo.typeId}</td>
                                <td class="hidden putdate">${bookVo.putdate}</td>
                                <td class="hidden description">${bookVo.description}</td>
                                <td class="bookName">${bookVo.bookName}
                                    <c:if test="${bookVo.isExitPDF==1}">
                                        <%--表示存在pdf文件的时候，就可以在线预览--%>
                                        <%--<i class="glyphicon glyphicon-tags">--%>
                                        <a class="glyphicon glyphicon-book" title="在线预览"
                                           style="color: blue"
                                           href="javascript:window.open('<%=basePath%>/static/generic/web/viewer.html?file='+ encodeURIComponent('/viewPdf/${bookVo.pdfURl}'), '_blank')">
                                        </a>
                                        <%--</i>--%>
                                    </c:if>
                                </td>
                                <td class="typeName">${bookVo.typeName}</td>
                                <td class="isbn">${bookVo.isbn}</td>
                                <td class="author">${bookVo.author}</td>
                                <td class="publisher">${bookVo.publisher}</td>
                                <td class="totalCount">${bookVo.totalCount}</td>
                                <td class="currentCount">${bookVo.currentCount}</td>
                                <td class="hidden price">${bookVo.price}</td>
                                <td>
                                    <button class="btn btn-info btn-xs btn-watch"
                                            style="margin-right: 3px">查看
                                    </button>
                                    <button class="btn btn-xs btn-success btn-update"
                                            style="margin-right: 3px">修改
                                    </button>
                                    <a class="btn btn-xs btn-danger btn-del"
                                       style="margin-right: 3px"
                                       href="<%=basePath%>/book/del/${bookVo.bookId}">下架
                                    </a>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </c:if>
                </table>
            </div>
            <%--显示页数导航栏--%>
            <div class="page-nav text-right">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li><a href="#">第${bean.pageNum}页/共${bean.totalPage}页</a></li>
                        <c:if test="${selectBook==false }">
                            <li><a href="<%=path%>/admin/bookmanager/1">首页</a></li>
                        </c:if>
                        <c:if test="${selectBook==true }">
                            <li><a href="<%=path%>/admin/bookmanager/1">首页</a></li>
                        </c:if>
                        <%--如果当前为第一页时,就没有上一页这个超链接显示 --%>
                        <c:if test="${bean.pageNum==1}">
                            <c:forEach begin="${bean.start }" end="${bean.end }" step="1"
                                       var="i">
                                <c:if test="${bean.pageNum ==i}">
                                    <li><a href="#">${i}</a></li>
                                </c:if>
                                <c:if test="${bean.pageNum !=i}">
                                    <c:if test="${selectBook==false }">
                                        <li><a href="<%=path %>/admin/bookmanager/${i}">${i}</a>
                                        </li>
                                    </c:if>
                                    <c:if test="${selectBook==true }">
                                        <li><a href="<%=path %>/admin/bookmanager/${i}">${i}</a>
                                        </li>
                                    </c:if>
                                </c:if>
                            </c:forEach>
                            <c:if test="${bean.totalPage!=1}">
                                <c:if test="${selectBook==false }">
                                    <li><a href="<%=path %>/admin/bookmanager/${bean.pageNum+1}"
                                           aria-label="Next"> <span
                                        aria-hidden="true">&raquo;</span>
                                    </a></li>
                                </c:if>
                                <c:if test="${selectBook==true }">
                                    <li><a href="<%=path %>/admin/bookmanager/${bean.pageNum+1}"
                                           aria-label="Next"> <span
                                        aria-hidden="true">&raquo;</span>
                                    </a></li>
                                </c:if>
                            </c:if>
                        </c:if>
                        <%--如果当前页不是第一页也不是最后一页,则有上一页和下一页 这个超链接的显示--%>
                        <c:if test="${bean.pageNum >1 && bean.pageNum < bean.totalPage}">
                            <c:if test="${selectBook==false }">
                                <li><a href="<%=path %>/admin/bookmanager/${bean.pageNum-1}"
                                       aria-label="Previous"> <span
                                    aria-hidden="true">&laquo;</span>
                                </a></li>
                            </c:if>
                            <c:if test="${selectBook==true }">
                                <li><a href="<%=path %>/admin/bookmanager/${bean.pageNum-1}"
                                       aria-label="Previous"> <span
                                    aria-hidden="true">&laquo;</span>
                                </a></li>
                            </c:if>
                            <c:forEach begin="${bean.start }" end="${bean.end }" step="1"
                                       var="i">
                                <c:if test="${bean.pageNum == i }">
                                    <li><a href="#">${i}</a></li>
                                </c:if>
                                <c:if test="${bean.pageNum != i }">
                                    <c:if test="${selectBook==false }">
                                        <li><a href="<%=path %>/admin/bookmanager/${i}">${i}</a>
                                        </li>
                                    </c:if>
                                    <c:if test="${selectBook==true }">
                                        <li><a href="<%=path %>/admin/bookmanager/${i}">${i}</a>
                                        </li>
                                    </c:if>
                                </c:if>
                            </c:forEach>
                            <c:if test="${selectBook==false }">
                                <li><a href="<%=path %>/admin/bookmanager/${bean.pageNum+1}"
                                       aria-label="Next"> <span aria-hidden="true">&raquo;</span>
                                </a></li>
                            </c:if>
                            <c:if test="${selectBook==true }">
                                <li><a href="<%=path %>/admin/bookmanager/${bean.pageNum+1}"
                                       aria-label="Next"> <span aria-hidden="true">&raquo;</span>
                                </a></li>
                            </c:if>
                        </c:if>
                        <%--如果当前页是最后一页,则只有上一页这个超链接显示,下一页没有 --%>
                        <c:if
                            test="${bean.pageNum ==  bean.totalPage && bean.pageNum!=1}">
                            <c:if test="${selectBook==false }">
                                <li><a href="<%=path %>/admin/bookmanager/${bean.pageNum-1}"
                                       aria-label="Previous"> <span
                                    aria-hidden="true">&laquo;</span>
                                </a></li>
                            </c:if>
                            <c:if test="${selectBook==true }">
                                <li><a href="<%=path %>/admin/bookmanager/${bean.pageNum-1}"
                                       aria-label="Previous"> <span
                                    aria-hidden="true">&laquo;</span>
                                </a></li>
                            </c:if>
                            <c:forEach begin="${bean.start }" end="${bean.end }" step="1"
                                       var="i">
                                <c:if test="${bean.pageNum == i }">
                                    <li><a href="#">${i }</a></li>
                                </c:if>
                                <c:if test="${bean.pageNum != i }">
                                    <c:if test="${selectBook==false }">
                                        <li><a href="<%=path %>/admin/bookmanager/${i}">${i}</a>
                                        </li>
                                    </c:if>
                                    <c:if test="${selectBook==true }">
                                        <li><a href="<%=path %>/admin/bookmanager/${i}">${i}</a>
                                        </li>
                                    </c:if>
                                </c:if>
                            </c:forEach>
                        </c:if>
                        <c:if test="${selectBook==false }">
                            <li><a href="<%=path %>/admin/bookmanager/${bean.totalPage }">尾页</a>
                            </li>
                        </c:if>
                        <c:if test="${selectBook==true }">
                            <li><a href="<%=path %>/admin/bookmanager/${bean.totalPage }">尾页</a>
                            </li>
                        </c:if>
                    </ul>
                </nav>
            </div>
        </div>
    </div>
</div>
<%--添加按钮的弹出框--%>
<div id="light" class="white_content">
    <button type="button" class="close closeBtn" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">×</span>
    </button>
    <div class="row">
        <div class="col-md-10 col-sm-offset-1">
            <!--保证样式水平不混乱-->
            <form class="form-horizontal" method="post" action="<%=basePath%>/book/add">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel">
                        添加新读者分类
                    </h4>
                </div>
                <div class="modal-body">
                    <!---------------------表单-------------------->
                    <div class="form-group">
                        <label for="isbn-add" class="col-sm-3 control-label">ISBN号</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="isbn-add" name="isbn">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="bookName-add" class="col-sm-3 control-label">图书名称</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="bookName-add"
                                   name="bookName">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="typeId-add" class="col-sm-3 control-label">图书类型</label>
                        <div class="col-sm-7">
                            <select
                                class="form-control" id="typeId-add"
                                name="typeId">
                                <%--<option></option>--%>
                                <c:forEach items="${booktypes}" var="bt">
                                    <option
                                        value="${bt.typeId}">${bt.typeName}
                                    </option>
                                </c:forEach>
                            </select>
                            <%--<input type="text" class="form-control" id="typeId-add" name="typeId">--%>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="author-add" class="col-sm-3 control-label">作者名称</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="author-add" name="author">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="publisher-add" class="col-sm-3 control-label">出版社</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="publisher-add"
                                   name="publisher">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="totalCount-add" class="col-sm-3 control-label">总数量</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="totalCount-add"
                                   name="totalCount">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="price-add" class="col-sm-3 control-label">价格</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="price-add" name="price">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="description-add" class="col-sm-3 control-label">简介</label>
                        <div class="col-sm-7">
                            <textarea class="form-control" rows="3" id="description-add"
                                      name="description">
                                
                            </textarea>
                        </div>
                    </div>
                    <!---------------------表单-------------------->
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default closeBtn" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="submit" class="btn btn-primary" id="addReaderType">
                        添加
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<%--弹出层的半透明背景--%>
<div id="fade" class="modal black_overlay"></div>
<%--弹出查看图书详情的弹出窗--%>
<div id="light-watch" class="white_content">
    <button type="button" class="close closeBtn" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">×</span>
    </button>
    <div class="row">
        <div class="col-md-10 col-sm-offset-1">
            <!--保证样式水平不混乱-->
            <form class="form-horizontal">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel1">
                        图书详情
                    </h4>
                </div>
                <div class="modal-body">
                    <!---------------------表单-------------------->
                    <div class="row">
                        <div class="form-group col-md-6">
                            <label for="isbn-add" class="col-md-4 control-label">书籍编号</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="bookId-wt" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="isbn-add" class="col-md-4 control-label">ISBN号</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="isbn-wt" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="bookName-add" class="col-md-4 control-label">图书名称</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="bookName-wt" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="typeId-add" class="col-md-4 control-label">图书类型</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="typeId-wt" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="author-add" class="col-md-4 control-label">作者名称</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="author-wt" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="publisher-add" class="col-md-4 control-label">出版社</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="publisher-wt" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="totalCount-add" class="col-md-4 control-label">总数量</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="totalCount-wt" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="totalCount-add" class="col-md-4 control-label">可借数量</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="currentCount-wt" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="price-add" class="col-md-4 control-label">价格</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="price-wt" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="price-add" class="col-md-4 control-label">上架日期</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="putdate-wt" />
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="description-add" class="col-md-2 control-label">图书简介</label>
                        <div class="col-md-9">
                            <textarea class="form-control" rows="5" id="description-wt"
                                      style="resize: none">
                            
                            </textarea>
                        </div>
                    </div>
                    <!---------------------表单-------------------->
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default closeBtn" data-dismiss="modal">
                        关闭
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<%--修改图书按钮的弹出框--%>
<div id="light-update" class="white_content">
    <button type="button" class="close closeBtn" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">×</span>
    </button>
    <div class="row">
        <div class="col-md-10 col-sm-offset-1">
            <!--保证样式水平不混乱-->
            <form class="form-horizontal" method="post" action="<%=basePath%>/book/update">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel-update">
                        修改图书详情
                    </h4>
                </div>
                <div class="modal-body">
                    <!---------------------表单-------------------->
                    <div class="row">
                        <div class="form-group col-md-6 hidden">
                            <label for="bookId-up" class="col-md-4 control-label">书籍编号</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="bookId-up"
                                       name="bookId" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="isbn-up" class="col-md-4 control-label">ISBN号</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="isbn-up" name="isbn" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="bookName-up" class="col-md-4 control-label">图书名称</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="bookName-up"
                                       name="bookName" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="typeId-up" class="col-md-4 control-label">图书类型</label>
                            <div class="col-md-8">
                                <select
                                    class="form-control" id="typeId-up"
                                    name="typeId">
                                    <%--<option></option>--%>
                                    <c:forEach items="${booktypes}" var="bt">
                                        <option
                                            value="${bt.typeId}">${bt.typeName}
                                        </option>
                                    </c:forEach>
                                </select>
                                <%--<input type="text" class="form-control" id="typeId-up" />--%>
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="author-up" class="col-md-4 control-label">作者名称</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="author-up"
                                       name="author" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="publisher-up" class="col-md-4 control-label">出版社</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="publisher-up"
                                       name="publisher" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="totalCount-up" class="col-md-4 control-label">总数量</label>
                            <div class="col-md-8">
                                <input type="number" class="form-control" id="totalCount-up"
                                       name="totalCount" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="currentCount-up" class="col-md-4 control-label">可借数量</label>
                            <div class="col-md-8">
                                <input type="number" class="form-control" id="currentCount-up"
                                       name="currentCount" />
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="price-up" class="col-md-4 control-label">价格</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" id="price-up"
                                       name="price" />
                            </div>
                        </div>
                        <%-- <div class="form-group col-md-6 hidden">
                             <label for="putdate-up" class="col-md-4 control-label">上架日期</label>
                             <div class="col-md-8">
                                 <input type="date" class="form-control" id="putdate-up"
                                        name="putdate" />
                             </div>
                         </div>--%>
                    </div>
                    <div class="form-group">
                        <label for="description-up" class="col-md-2 control-label">图书简介</label>
                        <div class="col-md-9">
                            <textarea class="form-control" rows="5" id="description-up"
                                      name="description">
                            
                            </textarea>
                        </div>
                    </div>
                    <!---------------------表单-------------------->
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default closeBtn" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="submit" class="btn btn-primary" id="updataBook">
                        更新
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<%--导入excel的弹出框--%>
<div id="light-import-excel" class="white_content">
    <button type="button" class="close closeBtn" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">×</span>
    </button>
    <div class="row">
        <div class="col-md-10 col-sm-offset-1">
            <!--保证样式水平不混乱-->
            <form class="form-horizontal" method="post" action="<%=basePath%>/book/readExcel"
                  enctype="multipart/form-data">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel-import-excel">
                        批量添加图书（上传excel）
                    </h4>
                </div>
                <div class="modal-body">
                    <!---------------------表单-------------------->
                    <div class="row">
                        <div class="form-group col-md-12">
                            <label for="import-excel" class="col-md-4 control-label">请选择excel
                                文件</label>
                            <div class="col-md-8">
                                <input type="file" id="import-excel"
                                       name="file" />
                            </div>
                        </div>
                    </div>
                    <!---------------------表单-------------------->
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default closeBtn" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="submit" class="btn btn-primary">
                        上传
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>